home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / ALTD201A.ZIP / VB4032.ZIP / VB40.32 / EX26VB.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-19  |  4.5 KB  |  165 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "VB Example 26"
  4.    ClientHeight    =   4785
  5.    ClientLeft      =   1410
  6.    ClientTop       =   735
  7.    ClientWidth     =   3750
  8.    Height          =   5190
  9.    Left            =   1350
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4785
  12.    ScaleWidth      =   3750
  13.    Top             =   390
  14.    Width           =   3870
  15.    Begin VB.CommandButton About 
  16.       Caption         =   "About"
  17.       Height          =   495
  18.       Left            =   240
  19.       TabIndex        =   7
  20.       Top             =   3960
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton Extract 
  24.       Caption         =   "Extract"
  25.       Height          =   495
  26.       Left            =   240
  27.       TabIndex        =   6
  28.       Top             =   3360
  29.       Width           =   1455
  30.    End
  31.    Begin VB.CommandButton Delete 
  32.       Caption         =   "Delete"
  33.       Height          =   495
  34.       Left            =   2040
  35.       TabIndex        =   5
  36.       Top             =   3360
  37.       Width           =   1335
  38.    End
  39.    Begin VB.CommandButton Command1 
  40.       Caption         =   "Exit"
  41.       Height          =   495
  42.       Left            =   2040
  43.       TabIndex        =   4
  44.       Top             =   3960
  45.       Width           =   1335
  46.    End
  47.    Begin VB.ListBox List1 
  48.       Height          =   2205
  49.       Left            =   2040
  50.       MultiSelect     =   2  'Extended
  51.       TabIndex        =   1
  52.       Top             =   240
  53.       Width           =   1335
  54.    End
  55.    Begin VB.FileListBox File1 
  56.       Height          =   2205
  57.       Left            =   240
  58.       Pattern         =   "*.zip"
  59.       TabIndex        =   0
  60.       Top             =   240
  61.       Width           =   1455
  62.    End
  63.    Begin Threed.SSPanel SSPanel1 
  64.       Height          =   375
  65.       Left            =   480
  66.       TabIndex        =   3
  67.       Top             =   2520
  68.       Width           =   2655
  69.       _Version        =   65536
  70.       _ExtentX        =   4683
  71.       _ExtentY        =   661
  72.       _StockProps     =   15
  73.       Caption         =   "SSPanel1"
  74.       BackColor       =   12632256
  75.       FloodType       =   1
  76.    End
  77.    Begin VB.TextBox JobProgress 
  78.       Height          =   375
  79.       Left            =   480
  80.       TabIndex        =   2
  81.       Text            =   "Job Progress -I'm invisible, dude"
  82.       Top             =   2880
  83.       Visible         =   0   'False
  84.       Width           =   2655
  85.    End
  86. Attribute VB_Name = "Form1"
  87. Attribute VB_Creatable = False
  88. Attribute VB_Exposed = False
  89. Option Explicit
  90. Dim z() As ALZipDir
  91. Dim LibraryHandle As Long
  92. Private Sub About_Click()
  93.   frmAbout.Text1 = "EX26VB demonstrates the simplified interface.  Double click on a"
  94.   frmAbout.Text1 = frmAbout.Text1 + " zip file to display its contents.  You can either"
  95.   frmAbout.Text1 = frmAbout.Text1 + " extract or delete the file from the archive."
  96.   frmAbout.Show 1
  97. End Sub
  98. Private Sub Command1_Click()
  99.     Unload Form1
  100.     End
  101. End Sub
  102. Private Sub Delete_Click()
  103.     Dim i As Integer
  104.     Dim j As Long
  105.     Delete.Enabled = 0
  106.     i = 0
  107.     While z(i).size <> -1
  108.         If List1.Selected(i) Then
  109.             z(i).mark = 1
  110.         Else
  111.             z(i).mark = 0
  112.         End If
  113.         i = i + 1
  114.     Wend
  115.     Delete.Enabled = 1
  116.     j = ALDelete(z(), 0, 0, JobProgress.hWnd)
  117.     File1_Click
  118. End Sub
  119. Private Sub Extract_Click()
  120.     Dim i As Integer
  121.     Dim j As Long
  122.     Extract.Enabled = 0
  123.     i = 0
  124.     While z(i).size <> -1
  125.         If List1.Selected(i) Then
  126.             z(i).mark = 1
  127.         Else
  128.             z(i).mark = 0
  129.         End If
  130.         i = i + 1
  131.     Wend
  132.     j = ALExtract(z(), 0, 0, 0, JobProgress.hWnd)
  133.     Extract.Enabled = 1
  134. End Sub
  135. Private Sub File1_Click()
  136.   Dim i As Integer
  137.   Dim j As Long
  138.   Dim count As Long
  139.   Dim error As Long
  140.   i = UBound(z, 1)
  141.   If z(i).compressed_size <> 0 Then ALFreeDir z
  142.   ALReadDir z(), File1.FileName, count, error
  143.   List1.Clear
  144.   For i = 0 To count - 1
  145.     List1.AddItem z(i).name
  146.   Next
  147. End Sub
  148. Private Sub Form_Load()
  149.   File1.Path = App.Path
  150.   ChDrive App.Path
  151.   ChDir App.Path
  152.   ReDim z(0)
  153.   LibraryHandle = LoadLibrary(DLLName)
  154.   If LibraryHandle = 0 Then
  155.     SSPanel1.Caption = "***Error loading " + DLLName + "***"
  156.     SSPanel1.FloodType = 0
  157.   End If
  158. End Sub
  159. Private Sub Form_Unload(Cancel As Integer)
  160.   FreeLibrary (LibraryHandle)
  161. End Sub
  162. Private Sub JobProgress_Change()
  163.   SSPanel1.FloodPercent = Val(JobProgress.text)
  164. End Sub
  165.